package foodmaterial.service.impl;

import org.springframework.util.StringUtils;

public class PasswordService {

    public static String checkPassword(String newPassword,String confirmPassword) {
        if (StringUtils.isEmpty(newPassword)) return "新密码不能为空" ;
        if (StringUtils.isEmpty(confirmPassword)) return "确认密码不能为空" ;
        if (newPassword.length() < 6) return "密码最小长度为6" ;
        if (!newPassword.equals(confirmPassword)) return "新密码和确认密码不相等";
        return null ;
    }
}
